STEP 7: Now let's create a random number to pick a random index from the head list!

  • Go to and drag Random Integer to the bottom of your program (in the second section!).
  • Change the variable name from my_var to random_head.
  • Change the range in .randint() to 0, 5.

Remember: there are 6 items in the list, so the first index is 0 and the last index is 5.

To navigate the page using the TAB key, first press ESC to exit the code editor.

######################################################################## # PLACE LIST CREATIONS HERE # ######################################################################## stage_list = ["moon", "mars", "jupiter", "pluto", "space", "city"] head_list = ["head1", "head2", "head3", "head4", "head5", "head6"] ######################################################################## # PLACE ALL OTHER CODE BELOW THIS # ######################################################################## stage_image = stage_list[1] stage.set_background(stage_image)
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)